/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.io.FileInputStream;
import java.io.FileOutputStream;

/**
 * <p>Project: jse2303 - Stream3
 * <p>Powered by webrx On 2023-07-21 10:59:50
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Stream3 {
    public static void main(String[] args) {
        try (
                FileInputStream fis = new FileInputStream("g.jpg");
                FileOutputStream fos = new FileOutputStream("ok.jpg")
        ) {
            //read() 读取一个字节 如果返回-1证明文件字节读到结尾了。
            //fis.skip(fis.available() - 15);
            //System.out.println(fis.read());
            //System.out.println(fis.read());
            //System.out.println(fis.read());
            //System.out.println(fis.read());

            //fis.readAllBytes()

            //byte[] buf = new byte[10];
            //System.out.println(Arrays.toString(buf));
            //System.out.println("----------");
            //int len = fis.read(buf);
            //System.out.println(len);
            //System.out.println(Arrays.toString(buf));
            //System.out.println("----------");
            //len = fis.read(buf);
            //System.out.println(len);
            //System.out.println(Arrays.toString(buf));

            //fos.write(fis.readAllBytes());

            //int b = 0;
            //while ((b = fis.read()) != -1) {
            //    fos.write(b);
            //}

            //5g 是一种无限

            //System.out.println(Arrays.toString(fis.readAllBytes()));


        } catch (Exception e) {

        }
    }
}
